<?php
$this->pageTitle = Lang::t('user.profile.page.breadcrumbs');
$this->breadcrumbs[] = Lang::t('user.profile.page.breadcrumbs');
?>
<div class="form">
    <?php
    $formConfig['htmlOptions']['class'] = 'form-horizontal';
    $formConfig['htmlOptions']['role'] = 'form';
    ?>
    <?php $form = $this->beginWidget('ActiveForm', $formConfig); ?>

    <h1><?php echo Lang::t('user.profile.page.title'); ?></h1>
    <span class="help-block"><?php echo Lang::t('user.profile.form.note'); ?></span>

    <?php
    echo $form->alert(array($user, $address), array(
        'errorMessageHtmlOptions' => array('class' => 'alert alert-danger'),
        'flashHtmlOptions' => array('class' => 'alert alert-'),
    ));
    ?>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'image_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->avatarUpload($user, 'image_', array('class' => 'form-control')); ?><?php //echo $form->error($user, 'image_');  ?>
        </div>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($user, 'username_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'username_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'username_');  ?>
        </div>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($user, 'firstName_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'firstName_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'firstName_');  ?>
        </div>
        
        <?php echo $form->labelEx($user, 'lastName_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'lastName_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'lastName_');  ?>
        </div>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'gender_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
            <?php
            echo $form->radioButtonList($user, 'gender_', $user->genderOption, array(
                'template' => '{beginLabel}{input} {labelTitle}{endLabel}',
                'labelOptions' => array('class' => 'radio-inline'),
                'separator' => ''
            ));
            ?><?php //echo $form->error($user,'gender_'); ?>
        </div>
        <?php echo $form->labelEx($user, 'dob_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php $form->dateSelector($user, 'dob_', array(
            'dateOptions'=>array(
                'class' => 'form-control',
                ),
            )); ?><?php //echo $form->error($user,'dob_'); ?>
        </div>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'ethnic_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->dropDownList($user, 'ethnic_', $user->ethnicOption, array('class' => 'form-control')); ?><?php //echo $form->error($user,'ethnic_'); ?>
        </div>
        
        <?php echo $form->labelEx($user, 'religion_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php
        echo $form->dropDownList($user, 'religion_', $user->religionOption, array(
            'empty' => Lang::t('user.profile.lbl.select.religion'),
            'class' => 'form-control'
        ));
        ?><?php //echo $form->error($user,'religion_'); ?>
        </div>
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'maritalStatus_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->dropDownList($user, 'maritalStatus_', $user->maritalStatusOption, array('class' => 'form-control')); ?><?php //echo $form->error($user,'maritalStatus_'); ?>
        </div>
    </div>

    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($user, 'phoneNumber_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'phoneNumber_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'phoneNumber_'); ?>
        </div>
            
        <?php echo $form->labelEx($user, 'faxNumber_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'faxNumber_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'faxNumber_'); ?>
        </div>            
    </div>

    <div class="form-group">
        <?php echo $form->labelEx($user, 'mobileNumber_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'mobileNumber_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'mobileNumber_'); ?>
        </div>            
        
        <?php echo $form->labelEx($user, 'email_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($user, 'email_', array('class' => 'form-control')); ?><?php //echo $form->error($user,'email_');  ?><?php //echo $form->error($user,'email_');  ?>
        </div>
    </div>    
    
    <hr />

    <div class="form-group">
        <?php echo $form->labelEx($address, 'country_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->dropDownList($address, 'country_', $address->countryOption, array(
            'class' => 'form-control',
            'ajax'=>array(
                'type'=>'POST',
                'url'=>Yii::app()->createUrl('ajax/countryname'),
                'update'=>'#country-name',
            ),
            )); ?><?php //echo $form->error($address,'country_'); ?>
        </div>    
    </div>
        
    <div class="form-group">
        <?php echo $form->labelEx($address, 'address_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-9">
        <?php echo $form->textField($address, 'address_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'address_');  ?>
        </div>    
    </div>

    <!--
    <div class="form-group">
        <?php echo $form->labelEx($address, 'street_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->textField($address, 'street_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'street_'); ?>
        </div>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($address, 'district_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->textField($address, 'district_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'district_');  ?>
        </div>
            
    </div>
    -->

    <div class="form-group">
        <?php echo $form->labelEx($address, 'city_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($address, 'city_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'city_');  ?>
        </div>
    
        <?php echo $form->labelEx($address, 'state_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($address, 'state_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'state_'); ?>
        </div>
    </div>    
    
    <!--
    <div class="form-group">
        <?php echo $form->labelEx($address, 'province_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->textField($address, 'province_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'province_'); ?>
        </div>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($address, 'typeNumber_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->textField($address, 'typeNumber_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'typeNumber_'); ?>
        </div>
    </div>
    
    <div class="form-group">
        <?php echo $form->labelEx($address, 'locality_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-4">
        <?php echo $form->textField($address, 'locality_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'locality_');  ?>
        </div>
            
    </div>
    -->

    <div class="form-group">
        <?php echo $form->labelEx($address, 'postalCode_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
        <?php echo $form->textField($address, 'postalCode_', array('class' => 'form-control')); ?><?php //echo $form->error($address,'postalCode_'); ?>
        </div>
        
        <?php echo $form->labelEx($address, 'country_', array('class' => 'col-sm-3 control-label')); ?>
        <div class="col-sm-3">
            <p id="country-name" class="form-control-static"></p>
        <?php //echo $form->dropDownList($address, 'country_', $address->countryOption, array('class' => 'form-control')); ?><?php //echo $form->error($address,'country_'); ?>
        </div>
    </div>

    <hr />

    <div class="form-group">
        <button type="submit" class="btn btn-default" /><?php echo Lang::t('user.profile.btn.submit'); ?></button>
    </div>

<?php $this->endWidget(); ?>
</div><!--form-->